<template>
  <div>
    <ul>
      <li v-for="item,index in brr" :key="index">
         {{item}}
      </li>
    </ul>
    <ul>
      <li >
        {{crr}}
      </li>
    </ul>
    <button @click="btn">乘以两倍</button>
  </div>
</template>

<script>
//必须用forEach方法, 把brr数组里的每个值, 乘以2倍, 添加到crr里, 然后把crr铺设到页面上显示
// var brr = [1, 0, 2, 0, 0, 0, 5]; 
//var crr = []; 
export default {
  data(){
    return{
      brr : [1, 0, 2, 0, 0, 0, 5],
      crr:[]
     
    }
  },
  methods: {
    btn(){
     let a= this.brr.forEach(item =>{
       this.crr.push(item*2)
     })
     
    }
       
  }
}
</script>

<style>

</style>